package com.pointtown.vcrss.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class RSSOpenHelper extends SQLiteOpenHelper {

	public static final String RSS_DATABASE = "RSS_DATABASE";
	public static final String RSS_TABLE = "RSS_TABLE";
	
	public static final String ID = "_id";
	public static final String TITLE = "title";
	public static final String LINK = "link";
	public static final String PUB_DATE = "pubDate";
	public static final String DESCRIPTION = "description";
	public static final String CATEGORY = "category";
	public static final String UPDATE_DATE = "update_date";
	public static final String REGIST_DATE = "regist_date";

	public RSSOpenHelper(Context context) {
		super(context, RSS_DATABASE, null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase database) {

		database.execSQL("CREATE TABLE " +
				RSS_TABLE +
				"(" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
				TITLE +  " TEXT not null, " +
				LINK + " link TEXT not null, " +
				PUB_DATE + " TEXT not null, " +
				DESCRIPTION + " TEXT not null, " +
				CATEGORY + " TEXT not null, " +
				UPDATE_DATE + " TEXT not null, " +
				REGIST_DATE + " TEXT not null );");
	}

	@Override
	public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {

	}

}
